<template>
	<view class="">
		<view class="list-content-bottom">
			<nav-bar :leftcustom="true"/>
			<view class="list-search">
				<u-search placeholder="请输入名称搜索" v-model="queryParam.kechengming" :showAction="false"
					@search="searchData" />
			</view>
			<view class="scrollCon padding-lr">
				<scroll-list :dataSource="dataSource" @reachBottom="reachBottom" :loadStatus="loadStatus">
					<template slot="scrollcon">
						<view class="list-datas-col2">
							<view class="list-datas-col2-item" v-for="(item,index) in dataSource" :key="index" @click="goDetail('/pages_permission/course/detail',item)">
								<view class="list-datas-col2-item-img">
									<image v-if="item.tupian" class="list-img" :src="getImgUrl(item.tupian)" mode="aspectFill"/>
									<view v-else class="noImg">暂无图片</view>
								</view>
								<view class="padding">{{item.kechengming}}</view>
							</view>
						</view>
						
					</template>
				</scroll-list>
			</view>
		</view>
		<c-tab-bar :tabValue="0" />
	</view>
</template>

<script>
	import CTabBar from '@/components/cTabBar/cTabBar';
	import ScrollList from '@/components/scrollLists.vue';
	import {
		ListMixin
	} from '@/common/mixins/mixins.js'
	import {getImgUrl} from '@/common/utils/index.js'
	export default {
		name: 'CourseList',
		desc: '课程列表',
		mixins: [ListMixin],
		components: {
			CTabBar,
			ScrollList
		},
		data() {
			return {
				getImgUrl,
				userInfo: this.$store.state.vuex_user, //用户信息
				
				urlapi: {
					list: '/kechengziliao/page'
				},
			}
		},
		onShow() {
			this.initDatas()
		},
		methods: {
			//初始化数据
			initDatas() {
				this.dataSource = []
				this.ipagination = {
					page: 1, //当前页
					size: 10, //每页多少条
					total: 0, //总条数
				}
				this.loadData()
			},
			searchData(e) {
				this.queryParam.kechengming = e
				this.initDatas()
			},
		}
	}
</script>

<style lang="scss" scoped>


</style>